package com.horay.springclouddemo.consumer.ribbon.configuration;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Random;

/**
 * 负载均衡配置
 *
 * @author heyingcheng
 * @date 2020/3/21 17:15
 */
@Configuration
public class RibbonConfiguration {

    @Bean
    public IRule randomRule() {
        return new RandomRule();
    }

}
